/**
 * 招标信息页签
 * @author miaoyl
 * @date 2018/01/14
 */
define(function () {

    var self,
        doc = document,
        app = win.app,
        layui = win.layui,
        element,
        table,
        table_where = {
            GWGA008: ''
        },
        cols = [[
            {field: 'GWGA001', width: 160, title: '招标编号', fixed: 'left', sort: true }
            , {field: 'GWGA002', width: 160, title: '项目名称', sort:true }
            , {field: 'GWGA004', width: 160, title: '公告时间', sort:true }
            , {field: 'GWGA005', width: 160, title: '公告获取结束时间', sort:true }
            , {field: 'GWGA006', width: 160, title: '开标时间', sort:true }
            , {field: 'GWGA013', width: 160, title: '总预算(万元)', sort:true }
            , {field: 'GWGA014', width: 160, title: '是否参与',filterDatas:app.datas_("sys_n_y")}
            , {field: 'GWGA015', width: 160, title: '未参与原因'}
        ]]
    ;

    var Gwga = app.Module.extend({
        init: function () {
            self = this;
            self._super({
                _tag: 'gwgaTabs',
            }, win);
        },

        initTable: function () {
            layui.use(['table'], function () {
                table = layui.table;
                table.render({
                    elem: app.getByid(doc, 'gwgaTabs'),
                    url: g_ctxPath + 'crm/gwgi001/getGwgaData',
                    method: 'post',
                    id: 'gwgaTabs',
                    size: _layuiConfig.ui_size,
                    autoSort: false, //禁用前端自动排序
                    height: 'full-10',
                    cols: cols,
                    page: true,
                    where: table_where,
                    done: function (res, curr, count) {

                    }
                });
            });
        },

        reloadTableCurr: function () {
            self._reloadTable({id: 'gwgaTabs', where: table_where});
        },

        _ready: function () {
            this._super({
                vue: [{
                    el: '#gwgaTabs',
                    data: '',
                    methods: {}
                }]
            });
            self.initTable();
        },
        _lazy: function () {
            this._super();
        }
    });

    return new Gwga();

});